package main

import "fmt"

// 结构体访问冲突的解决方式

type Address struct {
	Province   string
	City       string
	UpdateTime string
}

type Email struct {
	Add        string
	UpdateTime string
}

type Person struct {
	Name string
	Age  int
	Address
	Email
}

func main() {
	p1 := Person{
		Name: "孙事成",
		Age:  28,
		Address: Address{
			Province:   "安徽",
			City:       "阜阳",
			UpdateTime: "2021-10-01",
		},
		Email: Email{
			Add:        "1248185022@qq.com",
			UpdateTime: "2017-09-01",
		},
	}

	fmt.Printf("%#v", p1)
	// 要是使用UpdateTime 只能使用指定的结构下面的
	fmt.Println("\n", p1.Address.UpdateTime)
	fmt.Println(p1.Email.UpdateTime)
}
